package com.atguigu.lease.web.app.custom.config;

import com.atguigu.lease.common.constant.RedisConstant;
import com.atguigu.lease.web.app.custom.intercepter.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Ahmad
 * @date 2024/12/26 17:26
 * @description
 * 注册拦截器
 *
 */
@Configuration
public class MyWebConfig implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor).addPathPatterns("/app/**").excludePathPatterns("/app/login/**");
    }
}